<div id='jqxTabs'>
	<ul>
		<li>Detall empresa: </li>
	</ul>
	<div style="padding: 5px 0 0 5px">
		<form method="<?echo $this->form->getMethod() ?>" action="<?echo $this->form->getAction()?>" id="<?echo $this->form->getId()?>" enctype="<?echo $this->form->getEnctype()?>">
		<?php	
			echo $this->form->submit->renderViewHelper();
			?>
			<input type="button" value="Tancar sense guardar" id="tornar" name="tornar" onclick="history.back()">
			<input type="button" value="Esborrar imatge" id="esborrarImatge" name="esborrarImatge">
			
			<?php 
			
			echo $this->errorForm;
			
			echo $this->form->id_empresa->renderViewHelper();
			
			echo $this->form->titulo->renderLabel(); 
			echo $this->form->titulo->renderViewHelper();
			
			echo $this->form->texto->renderLabel(); 
			echo $this->form->texto->renderViewHelper();
			?>
			<div>
				<?php 
				if($this->form->imagen->getValue() !='')
				{
					$url = $this->form->imagen->getValue();
					echo "<img src='$url' alt='' >";
				}
				?>
			</div>
			<?php 
			echo $this->form->file->renderViewHelper();
			
			echo $this->form->imagen->renderViewHelper();
			
			echo $this->form->direccion->renderLabel(); 
			echo $this->form->direccion->renderViewHelper();
			
			echo $this->form->actividad->renderLabel();
			?>
			<div id='jqxComboBox'></div>
			<?php  
			echo $this->form->actividad->renderViewHelper();
			
			echo $this->form->cp->renderLabel(); 
			echo $this->form->cp->renderViewHelper();
			
			echo $this->form->localidad->renderLabel(); 
			echo $this->form->localidad->renderViewHelper();
			
			echo $this->form->telefono->renderLabel(); 
			echo $this->form->telefono->renderViewHelper();
			
			echo $this->form->fax->renderLabel(); 
			echo $this->form->fax->renderViewHelper();
			
			echo $this->form->email->renderLabel(); 
			echo $this->form->email->renderViewHelper();				
		?>
		
		</form>
	</div>
</div>
<script type="text/javascript">
            $(document).ready(function () {
                //Combo empresa
                jqxCreaComboList("/listados/actividades", "#jqxComboBox", "#actividad");
                var valor = $('#actividad').val();
                if(valor == false) 
                {
                	$('#actividad').val();
                	valor=0;
                }
                comboValue('#jqxComboBox', valor);

                $('#esborrarImatge').click(function(){
                	if(confirm('Vol esborrar la imatge?'))
                		borraImagen("/eliminar/foto-empresas/value/<?php echo $this->form->id_empresa->getValue()?>");
                });
                
                $('#jqxNavigationBar').jqxNavigationBar('expandAt', 2);
            });
        </script>